package com.basin.common.core.node;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: Sam ZHONG | sammy1997@aliyun.com
 */
@Data
public class BasinTreeNode<T> implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    private T rootNode;
    private List<BasinTreeNode<T>> childNodes;

    public BasinTreeNode(T rootNode) {
        this.rootNode = rootNode;
        this.childNodes = new ArrayList<>();
    }

    public void addChild(BasinTreeNode<T> child) {
        this.childNodes.add(child);
    }
}
